﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PSLibrary.Controls
{
    /// <summary>
    /// Clase Control que gestiona una lista de Controles "UserListElement". IMPLEMENTACION INCOMPLETA.
    /// </summary>
    public partial class UserList : UserControl
    {
        private List<UserListElement> items = new List<UserListElement>();

        public UserList()
        {
            InitializeComponent();
        }

        public List<UserListElement> Items
        {
            get { return this.items; }
        }

        public void Add(UserListElement element)
        {
            items.Add(element);
            this.flpUsers.Controls.Add(element);
            element.Width = this.flpUsers.Width - 6;
        }

        private void UserList_Resize(object sender, EventArgs e)
        {
            foreach (UserListElement element in items)
            {
                element.Width = this.flpUsers.Width - 6;
            }
        }

        private void flpUsers_Click(object sender, EventArgs e)
        {
            foreach (UserListElement element in items)
            {
                element.FOCUS = false;
            }
        }
    }
}
